<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>缤格</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/member.css"/>
    <script type="text/javascript" src="../../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../script/swiper.min.js"></script>
    <script type="text/javascript" src="../../script/mobile.js"></script>
    <script type="text/javascript">
        window['adaptive'].desinWidth = 750;
        window['adaptive'].baseFont = 28;
        window['adaptive'].maxWidth = 750;
        window['adaptive'].init();
    </script>
</head>
<body>
<section class="member_section bg-f5">

    <div class="match_box3 posr flex_center line_center flex_col c-fff bg-cover" id="teamBg">
        <div id="header" style="position: absolute; top: 0; left: 0; height: 0.9rem; background: transparent!important; width: 100%; z-index: 99">
            <header class="member_header ">
                <div class="header-left">
                    <div tapmode onclick="comeBack();" class="nav-left">
                        <img class="icon-back" src="../../icon/icon-back-white.png"/>
                    </div>
                </div>
            </header>
        </div>
        <img id="userIcon" src="../../image/team_member.png" class="tm_tx"/>
        <div class="f26 mt10" id="userName">杨旭</div>
        <div class="f22 mt10" id="userInfo">暂无简介</div>
        <div class="f20 mt10 line_center"><span id="nationality">中国</span> <i id="nationPic" style="background:url('') no-repeat center;" class="icon-zg ml10"></i></div>
        <ul class="member_box f26 c-666" style="bottom:-0.6rem;">
            <li>
                <div id="age">24</div>
                <div class="mt10">年龄</div>
            </li>
            <li>
                <div id="teamName">天津天海(9号)</div>
                <div class="mt10">队伍</div>
            </li>
            <li>
                <div id="position">大前锋</div>
                <div class="mt10">位置</div>
            </li>
        </ul>
    </div>

    <div class="bg-fff pl30 pr30 pt90">
        <h3>基本资料</h3>
        <div class="hang_box bb line_center f24">
            <span class="c-999 tm_title">出生日期</span>
            <span id="birth"></span>
        </div>
        <div class="hang_box bb line_center f24">
            <span class="c-999 tm_title">身高</span>
            <span id="height"></span>
        </div>
        <div class="hang_box bb line_center f24">
            <span class="c-999 tm_title">体重</span>
            <span id="weight"></span>
        </div>
        <div class="hang_box bb line_center f24">
            <span class="c-999 tm_title">出生地</span>
            <span id="birth_address"></span>
        </div>
        <div class="hang_box bb line_center f24">
            <span class="c-999 tm_title">民族</span>
            <span id="nation"></span>
        </div>
        <div class="hang_box bb line_center f24">
            <span class="c-999 tm_title">入学年份</span>
            <span id="enrollment_year"></span>
        </div>
    </div>

    <div class="bg-fff pl30 pr30 mt20 pt30 pb30 career_div">
        <h3>生涯</h3>
        <ul class="tmsy_list f24" id="career">
            <!--<li class="flex_Box hang_box bb line_center">
                <span class="c-999" style="width: 1.7rem;">2018-2016</span>
                <span style="width:1.6rem;" class="pr10">天津天海</span>
                <div style="width: 1.1rem">得分<span class="c-primary">25</span></div>
                <div style="width: 1.1rem">篮板<span class="c-primary">25</span></div>
                <div style="width: 1.1rem">助攻<span class="c-primary">25</span></div>
                <img class="arr_move" src='../../icon/move.png'/>
            </li>-->
        </ul>
    </div>

    <div class="bg-fff pl30 pr30 mt20 pt30 pb40 honor_div">
        <h3>历史荣誉</h3>
        <ul class="tmry mt20 f24" id="honor">
            <!--<li class="pt20 pb20">
                <div class="c-666 f26">东亚篮球锦标赛冠军1个</div>
                <div class="trmy_img">
                    <img src="../../image/jb_on.png"/>
                    <span class="f22 c-666 mt10">2017</span>
                </div>
            </li>
            <li class="pt20 pb20">
                <div class="c-666 f26">东亚篮球锦标赛冠军1个</div>
                <div class="trmy_img">
                    <img src="../../image/jb_on.png"/>
                    <span class="f22 c-666 mt10">2017</span>
                </div>
            </li>
            <li class="pt20 pb20">
                <div class="c-666 f26">东亚篮球锦标赛冠军1个</div>
                <div class="trmy_img">
                    <img src="../../image/jb_on.png"/>
                    <span class="f22 c-666 mt10">2017</span>
                </div>
            </li>-->
        </ul>
    </div>
</section>

</body>
</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
    var player_id = '';//队员id
    var status = '';//队员类型 1为教练，2为队员
    apiready = function () {
        $api.fixStatusBar($api.dom('#header'));
        api.setStatusBarStyle({
            style: 'light', //设置APP状态栏字体色
            color: 'rgba(255,255,255,0)', //设置APP状态栏背景色
        });
        //setFixStatusBar(); //设置状态栏
        pop.loading();
        keybackListener()
        player_id = api.pageParam.player_id;
        status = api.pageParam.status;

        if(status == 1){
            $(".career_div").hide()
            $(".honor_div").hide()
        }else {
            $(".career_div").show()
            $(".honor_div").show()
        }

        getTeamMember()

    }

    //获取球队信息
    function getTeamMember() {
        var param = {
            token: $api.getStorage('token'),
            player_id: player_id,//队员id
        }
        getAjax(Interface.get_player, param, function (res) {

            var data = res.data;

            if (isDefine(data)) {
                //个人信息
                var player = data.player;
                if(isDefine(player)){
                    //背景图
                    $("#teamBg").css({background: 'url(' + ajaxUrl + player.background_path + ') center no-repeat'});
                    //头像
                    $("#userIcon").attr('src', ajaxUrl + player.icon_path);
                    //名称
                    $("#userName").html(player.name);
                    //个人简介
                    $("#userInfo").html(player.brief_introduction);
                    //国籍
                    $("#nationality").html(player.notionality);
                    //国籍图片
                    $("#nationPic").css({background: 'url(' + ajaxUrl + player.noti_path + ') center no-repeat'});
                    //年龄
                    if(isDefine(player.age) && player.age != 0){
                        $("#age").html(player.age);
                    }else {
                        $("#age").html('未知');
                    }
                    //队伍名称
                    $("#teamName").html(player.team_title);
                    //位置
                    $("#position").html(player.position);
                    //出生日期
                    $("#birth").html(player.brith_time);
                    //身高
                    $("#height").html(player.height);
                    //体重
                    $("#weight").html(player.weight);
                    //出生地
                    $("#birth_address").html(player.brith_address);
                    //民族
                    $("#nation").html(player.nation);
                    //入学年份
                    $("#enrollment_year").html(player.entrance_time);

                }

                if(player.stype !=1&&player.stype !=2){
                    $('.career_div').hide()
                }


                //生涯
                var career = data.career;
                if(isDefine(career)){
                    var career_list = ''

                    if(player.stype == 1){
                        for (var i = 0; i < career.length; i++) {
                            var info = career[i];
                            var param = {"player_id":player_id,"player_name": player.name,"player_stype":player.stype};
                            career_list += '<li class="flex_Box hang_box bb line_center" tapmode onclick=\'commonUrl("team_member_sy",'+jsonChange(param)+')\'>' +
                                '                <span class="c-999" style="width: 1.7rem;">'+info.season_start+'-'+info.season_end+'</span>' +
                                '                <span style="width:1.6rem;" class="pr10">'+info.team_title+'</span>' +
                                '                <div style="width: 1.1rem">得分<span class="c-primary">'+info.score+'</span></div>' +
                                '                <div style="width: 1.1rem">篮板<span class="c-primary">'+info.backboard+'</span></div>' +
                                '                <div style="width: 1.1rem">助攻<span class="c-primary">'+info.assists+'</span></div>' +
                                '                <img class="arr_move" src=\'../../icon/move.png\'/>' +
                                '            </li>';
                        }
                    }else if(player.stype == 2){
                        for (var i = 0; i < career.length; i++) {
                            var info = career[i];
                            var param = {"player_id":player_id,"player_name": player.name,"player_stype":player.stype};
                            career_list += '<li class="flex_Box hang_box bb line_center" tapmode onclick=\'commonUrl("team_member_sy",'+jsonChange(param)+')\'>' +
                                '                <span class="c-999" style="width: 1.7rem;">'+info.season_start+'-'+info.season_end+'</span>' +
                                '                <span style="width:1.6rem;" class="pr10">'+info.team_title+'</span>' +
                                '                <div style="width: 1.1rem">进球<span class="c-primary">'+info.goal+'</span></div>' +
                                '                <div style="width: 1.1rem">助攻<span class="c-primary">'+info.assists+'</span></div>' +
                                '                <div style="width: 1.1rem">场均抢断<span class="c-primary">'+info.site_steals+'</span></div>' +
                                '                <img class="arr_move" src=\'../../icon/move.png\'/>' +
                                '            </li>';
                        }
                    }

                    $("#career").html(career_list)

                }else {
                    // $("#career").html('<p style="width: 100%;" class="t-c c-999 pt20 pb20">暂无生涯</p>')
                    $("#career").html(noData)
                }

                var honor = data.honor;
                if(isDefine(honor)){
                    var honor_list = ''
                    for (var i = 0; i < honor.length; i++) {
                        var info = honor[i];
                        honor_list += '<li class="pt20 pb20">' +
                            '                <div class="c-666 f26">'+info.title+'</div>' +
                            '                <div class="trmy_img">' +
                            '                    <img src="'+ajaxUrl + info.icon_path+'"/>' +
                            // '                    <span class="f22 c-666 mt10">2017</span>' +
                            '                </div>' +
                            '            </li>';
                    }

                    $("#honor").html(honor_list)

                }else {
                    // $("#honor").html('<p style="width: 100%;" class="t-c c-999 pt20 pb20">暂无历史荣誉</p>')
                    $("#honor").html(noData)
                }

            }
            pop.close();
        }, function (error) {
            pop.notice(error.msg);
            pop.close();
        })
    }





</script>
